package com.letao.controller;

import com.letao.common.pojo.EUDataGridResult;
import com.letao.common.pojo.LetaoResult;
import com.letao.pojo.TbContent;
import com.letao.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by ac on 2017/1/18.
 */
@Controller
@RequestMapping("/content")
public class ContentController {

    @Autowired
    private ContentService contentService;

    @RequestMapping("/save")
    @ResponseBody
    public LetaoResult save(TbContent content){
        return contentService.insertContent(content);
    }

    @RequestMapping("/query/list")
    @ResponseBody
    public EUDataGridResult queryList(Long categoryId, Integer page, Integer rows){
        return contentService.getContentList(categoryId, page, rows);
    }
}
